<?php
/* This file is part of Mirasol CMS
   (C) 2011 by Chris Alban Hansen.
   Released under the terms of the GNU General Public License.
   See COPYING in the top level directory of the Mirasol CMS installation. */

include "{$_SERVER['DOCUMENT_ROOT']}/includes/config.php";
include "{$_SERVER['DOCUMENT_ROOT']}/includes/settings.php";

if ($loadsubpage == 1)
{
  $sitename = htmlentities (getsetting ($connection, "sitename"), ENT_COMPAT, "UTF-8", false);
  $domainname = htmlentities (getsetting ($connection, "domainname"), ENT_COMPAT, "UTF-8", false);
  $protocol = getsetting ($connection, "protocol");
?>
<h1>Settings</h1>

<form method="post" action="../includes/savesettings.php">
  <table cellpadding="0" cellspacing="0" class="form operate">
    <tr>
      <td colspan="2" class="big bold" style="padding-bottom: 10px;">Basic Information</td>
    </tr>
    <tr>
      <td class="form bold">Site name:</td>
      <td class="formfield"><input type="text" name="sitename" value="<?=$sitename ?>" maxlength="100" class="textfield" style="width: 300px;" /></td>
    </tr>
    <tr>
      <td class="form bold">Domain name:</td>
      <td class="formfield">
        <select name="protocol">
          <option value="http"<?=$protocol == "http" ? " selected=\"selected\"" : ""?>>http://</option>
          <option value="https"<?=$protocol == "https" ? " selected=\"selected\"" : ""?>>https://</option>
        </select>
        <input type="text" name="domainname" value="<?=$domainname ?>" maxlength="255" class="textfield" style="width: 300px;" />
      </td>
    </tr>
    <tr>
      <td colspan="2" class="divider"></td>
    </tr>
    <tr>
      <td colspan="2" class="big bold" style="padding-top: 10px; padding-bottom: 10px;">Extra Features</td>
    </tr>
    <tr>
      <td class="form bold">Enable datasheets:</td>
      <td><input type="checkbox" name="use_datasheets" value="1" <?=getsetting ($connection, "use_datasheets") == 1 ? "checked=\"checked\" " : "" ?>/></td>
    </tr>
    <tr>
      <td colspan="2"><input type="submit" value="Save" class="button alignright" /></td>
    </tr>
  </table>
</form>
<?php
}
?>
